Skip to content

Remove unused worktree argument from lease lifecycle transport - #5372

Merged
huangruiteng merged 1 commit into
mainfrom
codex/lease-lifecycle-cleanup
Sep 30, 2026
Merged

huangruiteng merged 1 commit into
mainfrom
codex/lease-lifecycle-cleanup

Conversation

@huangruiteng

Copy link
Copy Markdown
Collaborator

The worktree option belongs to lease acquisition. Remove the unused write_worktree argument from the internal lifecycle transport so renew/release do not advertise a value they ignore, and refresh the generated census coordinate. This addresses the non-blocking cleanup identified in #5364.

Validation: two real File/SQLite CLI lifecycle scenarios pass; focused Mypy (--follow-imports=silent) and Ruff pass; semantic drift/census and diff checks pass. This is a behavior-preserving removal with no new protocol, state format or UI change.

Signed-off-by: huangruiteng <huangrt01@163.com>

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

Reviewed exact head: 83b2f3183d3acf1f68cc67e20435c8a7cd1fc082; immutable base: 3156771e47268433c4b4b233bd37bdd3f2b37726. 本文执行当前 pull_request_review_execution_contract_v2(policy revision 12),覆盖完整 2 文件 +1/-2 diff。无阻塞发现。

动机

这项维护来自 #5364 已发布评审的非阻塞简化建议:execute_native_task_lease_lifecycle 声明了 write_worktree,但既不读取也不序列化,没有 repository caller 传入。worktree 观察属于 acquire,生命周期操作保留冻结的 execution identity,不能让 signature 暗示 renew/release 可重新绑定 workspace。它是明确的 API 清晰度改进,不是修复未被证明的性能问题,也不替代父级 R5/provider 验收。

改动思路

最小可行方案是删除无效的内部 keyword,保留 acquire 路径和现有 TypeScript 决策 owner。没有必要增加兼容 wrapper、第二个 Python 状态判断、额外协议版本或新的公共参数。当前 CLI 在第142行已经强制 --write-worktree 只用于 acquire;第160行只向 acquire transport 转发它。对所有 lifecycle call sites 和 unchanged surrounding branches 的搜索确认,无 caller 依赖被删参数。

具体改动

  • adapter signature 删除一个未使用的可选参数;函数体、native/canonical request 字典、authority facts、CAS、timeout 和 settlement/readback 路径不变。
  • registry I/O manifest 仅把 codec_read 的源码定位719改为718,stable site identity、API和规则归属未改。重新生成校验为260sites current。
  • acquisition 的 optional write_worktree 仍在357行定义,396–399行按原逻辑锚定路径并仅在显式提供时转发;typed workspace observer/admission和旧lease兼容没有改动。

关键代码讲解

  1. loopx/control_plane/work_items/task_lease_acquire_adapter.py:570 execute_native_task_lease_lifecycle:既有 authority snapshot 和 owner/key/version 输入组成同一个版本化 request,交给 task_lease.lifecycle.native。此次只去掉无效声明,未削弱需要的 proof、canonical fail-closed 或 receipt replay。
  2. loopx/control_plane/work_items/task_lease_acquire_adapter.py:357 execute_native_task_lease_acquire:显式 acquisition worktree 的真正 transport owner 仍完整保留;它不被移动到 renewal 或隐式激活。
  3. loopx/control_plane/work_items/task_lease.py:783 renew_task_lease:公开 wrapper 转交 current version、holder identity/key 和 TTL。实际 renew 保留 epoch/scope,transfer 再递增 epoch,release/replay 和独立 inspect 读回原 receipt;这些行为由 unchanged TS owner决定。

future-facing pass 已落实为最近 owner 上的 signature 删除,不需要更宽迁移。没有 frontend/Lark companion:完整 diff 没有 public schema、CLI注册/help、settings或呈现改动;用户操作入口仍是现有 task-lease CLI,而非只凭“backend-only”标签判断。

对主干的风险

最强风险是遗漏某个 caller,导致运行时 unexpected keyword,或同一次清理误丢实际CAS参数。独立扫描七处 lifecycle调用及测试 direct calls,没有 write_worktree lifecycle 传入。实际固定时钟 fixture 在不可变 base 和 exact head 各通过20个真实CLI观察(File/SQLite,每个10个):wrong owner/缺version拒绝 → renew →相同request replay → changed replay拒绝 → transfer → stale release拒绝 →正常release及replay →独立inspect inactive。比对完整输出,仅归一fixture目录和provider_revision不透明token,保留provider/counter/重复关系、诊断、lease proof、request hash和receipt。归一SHA为 c4b74cd9bda743da1d4d7877d09fd4d2cadb06fd9264377fdd475d322c1f0b02。

同一公开 parser/dispatch/TS/File 路径的 dropped-expected_version mutation 在合法 renew 处以 version_required 使独立oracle失败,正常head通过;不是只测mock helper或以两个新provider互相一致代替旧基线。合成初始化和内部clock seam不操作活动Goal,也不宣称provider promotion。

独立验证:92项Python tests、95项native tests、control-plane TypeScript typecheck、focused Mypy(follow-imports=silent,1source)、changed-file Ruff、260site manifest/advisory及最终risk-based premerge通过。CQA在精确final scope另行记录并验证;不继承作者receipt。审阅者初次harness argv/错误码选择与premerge flag错误原样保留,修正私有命令后再运行,未修改产品或放松断言。wait_for_ci=false,没有获取、等待或以远端红CI替代局部归因。

语义与CI对齐

未引入state vocabulary、持久化字段或第二决策源;manifest行号不是authority。CAS是机器强制条件,worktree integration advisory不因此扩权。这个Python transport签名清理没有存储/事务/SQL或TS协议变更,实际File/SQLite路径已验证;不把未运行的PostgreSQL部署/服务验收说成通过,也不把无关provider资格当本维护的完成条件。任意外部直接导入内部函数并传无效keyword的兼容性未声称证明;公开入口无此支持合同。当前diff没有新增安装/可选激活/default-off claim。

我的整体评价

APPROVE。请求中的局部维护已完成,内部调用关系更清楚,支持的续租、交接、释放和后续读回保持不变。范围与问题相称,没有为了小改动制造抽象、状态或新门。评审结论不是merge readiness或合并授权:按控制面仓库政策留给维护者决定,本轮没有自合并、admin bypass、活动安装升级或Goal终结。

English verdict: APPROVE - exact head 83b2f31. The unused internal lifecycle keyword is removed without changing serialized requests or supported CLI behavior; immutable-base/exact-head real File/SQLite lifecycle observations match, a public-path CAS-drop mutation fails the independent oracle, and focused validation passes. No merge or deployment qualification is implied.

@huangruiteng
huangruiteng merged commit 9c9b90d into main Sep 30, 2026
25 of 31 checks passed
@huangruiteng
huangruiteng deleted the codex/lease-lifecycle-cleanup branch September 30, 2026 21:22
@huangruiteng

Copy link
Copy Markdown
Collaborator Author

Merged with explicit maintainer authorization after the independent exact-head review of 83b2f3183d3acf1f68cc67e20435c8a7cd1fc082 and a ready=true managed merge-readiness result. CI was not consulted under the configured policy.

The installed snapshot now identifies merge commit 9c9b90d8eb9972c6d2a308750db5fc22a53c5df3; doctor and source activation readback pass. Six regression cases exercised the actual installed CLI against disposable File and SQLite stores, covering bound-wait settlement and worktree lease lifecycle; all passed. This verifies the delivered cleanup and preceding fixes, not a broader provider-default or PostgreSQL rollout qualification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant